package report.design.config;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import report.base.Inter;
import report.design.actions.CloseReportAction;
import report.design.actions.ExitAction;
import report.design.actions.NewReportAction;
import report.design.actions.OpenReportAction;
import report.design.actions.SaveReportAction;

public class MenuBarDef extends JMenuBar{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public MenuBarDef(){
		JMenu fileMenu = new JMenu(Inter.getLocText("File"));
		JMenuItem newItem = new JMenuItem(Inter.getLocText("New"));
		JMenuItem saveItem = new JMenuItem(Inter.getLocText("Save"));
		JMenuItem openItem = new JMenuItem(Inter.getLocText("Open"));
		JMenuItem closeItem = new JMenuItem(Inter.getLocText("Close"));
		JMenuItem exitItem = new JMenuItem(Inter.getLocText("Exit"));
		
		newItem.addActionListener(new NewReportAction());
		saveItem.addActionListener(new SaveReportAction());
		openItem.addActionListener(new OpenReportAction());
		closeItem.addActionListener(new CloseReportAction());
		exitItem.addActionListener(new ExitAction());
		
		fileMenu.add(newItem);
		fileMenu.add(saveItem);
		fileMenu.add(openItem);
		fileMenu.add(closeItem);
		fileMenu.add(exitItem);
		
		this.add(fileMenu);
	}
}
